/*
package com.yykj.drup.server.config;

import com.yykj.drup.server.model.DoctorStore;
import com.yykj.drup.server.service.DoctorStoreService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import java.util.List;

*/
/**
 * @Author zeng
 * @Date 2022/3/25
 *//*

@Component
@Order(1)
@Slf4j
@AllArgsConstructor
public class DoctorStoreRedisInit implements CommandLineRunner {

    final DoctorStoreService doctorStoreService;
    final RedisTemplate redisTemplate;

    @Override
    public void run(String... args) throws Exception {
        log.info("医生常用药店初始化缓存开始。。。。");
        //获取系统所有医生列表
        List<DoctorStore> doctorStores = doctorStoreService.list();
        if (!doctorStores.isEmpty()){
            for (DoctorStore i : doctorStores) {
                redisTemplate.opsForSet().add(i.getDoctorId(),i.getStoreId());
            }
        }
    }
}
*/
